from __future__ import unicode_literals

from django.db import models
import uuid
from django.contrib.auth.models import User

# Create your models here.
class ArticleModel(models.Model):
	uid = models.UUIDField(primary_key=True,default=uuid.uuid4,editable=False)
	author = models.ForeignKey(User,null=True)
	title = models.CharField(max_length=100)
	category = models.ForeignKey('CategoryModel')
	desc = models.CharField(max_length=200)
	thumbnail = models.URLField(blank=True)
	tags = models.ManyToManyField('TagModel',blank=True)
	content_html = models.TextField()

class CategoryModel(models.Model):
	name = models.CharField(max_length=20,unique=True)

class TagModel(models.Model):
	name = models.CharField(max_length=20,unique=True)